package com.tingyuge.thinking.spring.validation;

import com.tingyuge.thinking.spring.ioc.overview.domain.User;

import javax.xml.bind.SchemaOutputResolver;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.util.stream.Stream;

/**
 * @author xiaodao
 * @version 1.0
 * @date 2021/12/12
 * @description
 */
public class JavaBeansDemo {

    public static void main(String[] args) throws IntrospectionException {
        //stopClass (排除(截止类))
        BeanInfo beanInfo = Introspector.getBeanInfo(User.class,Object.class);
        //属性描述符  propertyDescriptor
        Stream.of(beanInfo.getPropertyDescriptors())
                .forEach(desc->{
                    System.out.println(desc);
                });
        //输出user定义的方法
        Stream.of(beanInfo.getMethodDescriptors()).forEach(System.out::println);
    }
}
